package stringh;

public class H3 {
    public static void main(String[] args) {
        String  s="Call Me Ishmael";
        System.out.println(s);
        System.out.println(s.length());
        System.out.println(s.charAt(s.length() - 1));
        String substring = s.substring(s.indexOf("C"), (s.indexOf("l") + 2));
        System.out.println(substring);
        String substring1 = s.substring(5, 7);
        System.out.println(substring1);

        String i = s.substring(s.lastIndexOf("I"));
        System.out.println(i);
        String substring2 = s.substring(s.indexOf("M"), (s.indexOf("e") + 1));
        System.out.println(substring2);
        String substring3 = s.substring(s.indexOf("C"), (s.indexOf("l") + 2));
        String  s1=i+" "+substring2+" "+substring3;
        System.out.println(s1);
        //11
        System.out.println(i.compareTo(substring2));
        System.out.println(i.compareTo(substring3));
        System.out.println(substring3+"\n"+i+"\n"+substring2+"\n");
        //12
        String s2 = s.toLowerCase();
        System.out.println(s2);
        String s3 = s.toUpperCase();
        System.out.println(s3);
        //13
        System.out.println(s.contentEquals("me"));
        //14
        System.out.println(s.startsWith("Tsh"));
        System.out.println(s.endsWith("txt"));
        //15
        String trim = s.trim();
        System.out.println(trim);
    }
}
